package cn.elricyu.tt.bean.tech;

import cn.elricyu.tt.bean.CompareValue;

public class Technology implements CompareValue {

    private String techid;

    private String techname;

    private String intro;

    private int jyungong;

    private int techlevel;

    private int upgradelevel;

    private int maxtechlevel;

    private int cdtime;

    private int order;

    public String getTechid() {
        return techid;
    }

    public void setTechid(String techid) {
        this.techid = techid;
    }

    public String getTechname() {
        return techname;
    }

    public void setTechname(String techname) {
        this.techname = techname;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public int getJyungong() {
        return jyungong;
    }

    public void setJyungong(int jyungong) {
        this.jyungong = jyungong;
    }

    public int getTechlevel() {
        return techlevel;
    }

    public void setTechlevel(int techlevel) {
        this.techlevel = techlevel;
    }

    public int getUpgradelevel() {
        return upgradelevel;
    }

    public void setUpgradelevel(int upgradelevel) {
        this.upgradelevel = upgradelevel;
    }

    public int getMaxtechlevel() {
        return maxtechlevel;
    }

    public void setMaxtechlevel(int maxtechlevel) {
        this.maxtechlevel = maxtechlevel;
    }

    public int getCdtime() {
        return cdtime;
    }

    public void setCdtime(int cdtime) {
        this.cdtime = cdtime;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    @Override
    public Object getValue(int type) {
        Object valueObject = order;
        switch (type) {
        case 0:
            valueObject = techname;
            break;
        case 1:
            valueObject = techlevel;
            break;

        }
        return valueObject;
    }

    @Override
    public Object getValue() {
        return order;
    }

    public boolean canLevelup() {
        if (this.techlevel >= this.maxtechlevel) {
            return false;
        }
        return true;
    }

}
